<?php 
$this->load->helper('form');

// Building the array for the drop down for expense category.
$category = array();
$category['0'] = 'SELECT';
$category_array = $this->global_model->global_get_categories('expense');

// Populating the $category array with the query result.
foreach ($category_array as $value) {
	$category[$value['cid']] = $value['name'];
}

print form_open('category/subcatsubmit','class="form-noinline"');
?>

<div class="input-prepend">
	<span class="add-on">Main Category</span> 
	<?php print form_dropdown('category',$category,'','id="category-selector"'); ?>
</div>
<br />
<div class="input-prepend">
	<span class="add-on">Sub Category</span> 
	<?php print form_input('subcat',''); ?>
</div>

<br />
<?php print form_submit('save','Save','class="btn btn-primary"'); ?>

<?php print form_close(); ?>